import request from './request'

/**
 * 用户登录
 * @param {Object} params - 参数 mobile password
 */
export const login = params => {
  return request.post('appLogin', params)
}

export const loginOut = () => {
  return request.post('/auth/logout')
}


/**
 * 微信小程序用户登录
 * @param {Object} params - 参数 mobile password
 */
export const wxLogin = params => {
  return request.post('auth/login',params,{header:{isEncrypt: true}})
}

/**
 * 微信小程序用户手机号登录
 * @param {Object} params - 参数 mobile password
 */
export const wxPhoneLogin = params => {
  return request.get('wxPhoneLogin',params)
}

/**
 * 获取路由信息
 */
export const getRouters = () => {
  return request.get('getRouters')
}

/**
 * 获取用户信息
 */
export const getInfo = () => {
  return request.get('system/user/getInfo')
}

// 注册
export const register = params => {
  return request.post('/auth/register', params,{'header':{'isEncrypt': true}})
}